package com.example.demo.control;

import com.example.demo.service.GetPassService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@ResponseBody
@Controller
public class GetPassControl {
    @Resource
    GetPassService getPassService;
    @GetMapping("/code")
    void getPassCode(HttpSession session , HttpServletResponse resp){
        getPassService.getPassCode(session ,resp);
    }

    @PostMapping("/getpass")
    String getpass(HttpSession session ,String account ,String option,String accountanser,String accountcode){
        return getPassService.getPass(session ,account ,option,accountanser,accountcode);
    }@PostMapping("/changepass")
    String changepass(HttpSession session,String accountpass){
        return getPassService.changePass(session,accountpass);
    }
}

